package org.szy.plugin.dev.entity;

import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.keygen.KeyGenerators;

import java.time.LocalDateTime;

/**
 * 登录日志表实体
 *
 * @author wangbuhao
 * @since 2023-06-19 11:08:21
 **/
@Table(value = "dev_login_log")
public class DevLoginLog {


    @Id(keyType = KeyType.Generator, value = KeyGenerators.flexId)
    private Long id;

    /**
     * 登录类型
     */
    private String type;

    /**
     * 用户标识
     */
    private Long userId;

    /**
     * 登录名称
     */
    private String account;

    /**
     * 登录状态
     */
    private Integer status;

    /**
     * 登录描述
     */
    private String msg;

    /**
     * 登录时间
     */
    private LocalDateTime time;

    /**
     * 登录Ip
     */
    private String clientIp;

    /**
     * 登录地址
     */
    private String location;
    /** 操作系统 */
    private String os;
    /** 浏览器类型 */
    private String browser;
    /** 登录设备 */
    private String device;


    public DevLoginLog() {
    }

    public DevLoginLog(Long id, String type, Long userId, String account, Integer status, String msg, LocalDateTime time, String clientIp, String location) {
        this.id = id;
        this.type = type;
        this.userId = userId;
        this.account = account;
        this.status = status;
        this.msg = msg;
        this.time = time;
        this.clientIp = clientIp;
        this.location = location;
    }

    public DevLoginLog(String type, Long userId, String account, Integer status, String msg) {
        this.type = type;
        this.userId = userId;
        this.account = account;
        this.status = status;
        this.msg = msg;
        this.time = LocalDateTime.now();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public LocalDateTime getTime() {
        return time;
    }

    public void setTime(LocalDateTime time) {
        this.time = time;
    }

    public String getClientIp() {
        return clientIp;
    }

    public void setClientIp(String clientIp) {
        this.clientIp = clientIp;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getOs() {
        return os;
    }

    public void setOs(String os) {
        this.os = os;
    }

    public String getBrowser() {
        return browser;
    }

    public void setBrowser(String browser) {
        this.browser = browser;
    }

    public String getDevice() {
        return device;
    }

    public void setDevice(String device) {
        this.device = device;
    }
}
